package logger

import (
	"fmt"
	"os"
	"sync"

	"github.com/rs/zerolog"
)

var logger *zerolog.Logger

var once sync.Once

func GetLogger() *zerolog.Logger {
	return logger
}

func InitLogger() {
	l := zerolog.New(os.Stderr).With().Timestamp().Logger()
	logger = &l
}

func init() {
	fmt.Println("logger------------------------init")
	once.Do(InitLogger)
}
